<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script>
                function title() {
                    document.getElementById('atendimento').className='selected';
                }
                window.onload=title;
            </script>
            <h:form id="incomeCreate" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Modelos de Laudo
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns">
                        <fieldset>

                            <p:panel id="panelIResumo" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix " >

                                <div class="grid_5">
                                    <p:menu  >
                                        <p:submenu label="Menu">
                                            <p:menuitem url="createTemplateAppraisal.xhtml" value="Cadastrar" icon="ui-icon-disk"/>
                                        </p:submenu>

                                    </p:menu>
                                </div>
                                <div class="grid_19">

                                    <p:dataTable id="tableResumo" var="cat" value="#{managerSearchTemplateAppraisal.templateAppraisals}" 
                                                 styleClass="grid_24"
                                                 rowIndexVar="rowid"
                                                 rowKey="#{cat.id}"
                                                 rows="15" paginator="true"  
                                                 paginatorPosition="bottom"
                                                 emptyMessage="Nenhum registro"
                                                 >  
                                        <f:facet name="header">
                                            Resumo
                                        </f:facet>  
                                        <p:column headerText="Ação" width="5">

                                            <p:button icon="ui-icon-search" 
                                                      outcome="editTemplateAppraisal.xhtml?templateEdit=#{cat.id}"
                                                      alt="Visualizar Modelo" title="Visualizar Modelo"
                                                      style="width: 25px; position: relative;"/>

                                        </p:column>
                                        <p:column headerText="Titulo" style="white-space: pre-wrap;" width="400">  
                                            <h:outputText value="#{cat.name}"/>
                                        </p:column>  
                                        <p:column headerText="Categorias" width="400" style="white-space: pre-wrap;">  
                                            <ui:repeat value="#{cat.categorys}" var="c">
                                                <h:outputText value="#{c.ordem} - #{c.titulo}"/><br/>
                                            </ui:repeat>
                                        </p:column>  

                                    </p:dataTable>
                                </div>

                            </p:panel>

                        </fieldset>
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
